home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////
- //
- // Source file for Control
- //
- // This file generated by a BuilderXcessory. DO NOT EDIT THIS FILE.
- // TO ADD EXTENSIONS TO THIS CLASS, USE THE BUILDER XCESSORY
- // TO CREATE A SUBCLASS.
- //
- // This class is a user interface "component", as described
- // in "Object-Oriented Programming with C++ and OSF/Motif",
- // by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
- //
- //
- /////////////////////////////////////////////////////////////
-
-
- #include "Control.h" // Generated header file for this class
- #include <Xm/PushB.h>
- #include <Xm/RowColumn.h>
- #ifndef XmNrow
- #define XmNrow "row"
- #endif
- #ifndef XmNcolumn
- #define XmNcolumn "column"
- #endif
-
-
-
-
-
- // These are default resources for widgets in objects of this class
- // All resources will be prepended by *<name> at instantiation,
- // where <name> is the name of the specific instance, as well as the
- // name of the baseWidget. These are only defaults, and may be overriden
- // in a resource file by providing a more specific resource name
-
- String Control::_defaultControlResources[] = {
- NULL
- };
-
- Control::Control(const char *name, Widget parent) :
- VkComponent(name)
- {
- Arg args[2];
- Cardinal count;
-
- count = 0;
-
- // Load any class-defaulted resources for this object
-
- setDefaultResources(parent, _defaultControlResources );
-
-
-
- // Create an unmanaged widget as the top of the widget hierarchy
-
- _baseWidget = _control= XtVaCreateWidget ( _name,
- xmRowColumnWidgetClass,
- parent,
- XmNorientation, XmHORIZONTAL,
- XmNpacking, XmPACK_COLUMN,
- NULL);
-
- // install a callback to guard against unexpected widget destruction
-
- installDestroyHandler();
-
-
- // Create widgets used in this component
- // All variables are data members of this class
-
- _startButton = XtVaCreateManagedWidget ( "startButton",
- xmPushButtonWidgetClass,
- _w,
- XmNx, 3,
- XmNy, 3,
- XmNwidth, 49,
- XmNheight, 30,
- NULL);
-
- XtAddCallback ( _startButton,
- XmNactivateCallback,
- &Control::startCallback,
- (XtPointer) this );
-
-
- _stopButton = XtVaCreateManagedWidget ( "stopButton",
- xmPushButtonWidgetClass,
- _w,
- XmNx, 55,
- XmNy, 3,
- XmNwidth, 49,
- XmNheight, 30,
- NULL);
-
- XtAddCallback ( _stopButton,
- XmNactivateCallback,
- &Control::stopCallback,
- (XtPointer) this );
-
-
- }
-
- Control::~Control()
- {
- // Empty Destructor. Base class destroys widgets
- }
-
- const char * Control::className() // classname
- {
- return ("Control");
- }
-
- void Control::startCallback (Widget w, XtPointer clientData, XtPointer callData)
- {
- Control* obj = (Control *) clientData;
-
- obj->start(w, callData);
- }
-
- void Control::stopCallback (Widget w, XtPointer clientData, XtPointer callData)
- {
- Control* obj = (Control *) clientData;
-
- obj->stop(w, callData);
- }
-
-
-
- void Control::start(Widget, XtPointer)
- {
- // Empty virtual function. Called from startCallback.
- // Derived classes can override.
- }
-
- void Control::stop(Widget, XtPointer)
- {
- // Empty virtual function. Called from stopCallback.
- // Derived classes can override.
- }
-
-
-
-